package com.object.module.cbb.frontEnd;

import com.object.configuration.utils.PageUtils;
import com.object.configuration.utils.Q;
import com.object.module.cbb.entity.CddRechargeDetailsEntity;
import com.object.module.cbb.service.CddRechargeDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


/**
 * 充值明细表
 *
 * @author 小🌤
 * @email 1578442339@qq.com
 * @date 2022-01-06 13:24:36
 */
@RestController
@RequestMapping("/frontend/rechargedetails")
public class FrontEndCddRechargeDetailsController {
    @Autowired
    private CddRechargeDetailsService cddRechargeDetailsService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public Q list(@RequestParam Map<String, Object> params) {
        PageUtils page = cddRechargeDetailsService.queryPage(params);
        return Q.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{rdUuid}")
    public Q info(@PathVariable("rdUuid") String rdUuid) {
        CddRechargeDetailsEntity cddRechargeDetails = cddRechargeDetailsService.getById(rdUuid);
        return Q.ok().put("cddRechargeDetails", cddRechargeDetails);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public Q save(@RequestBody CddRechargeDetailsEntity cddRechargeDetails) {
        cddRechargeDetailsService.save(cddRechargeDetails);
        return Q.ok();
    }


}
